package com.appsys.service;

import com.appsys.dao.BackendMapper;
import com.appsys.dao.DevMapper;
import com.appsys.pojo.Backend;
import com.appsys.pojo.Dev;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

/**
 * @ClassName LoginService
 * @Description TODO
 * @Author YinLiangTao Email:1517535831@qq.com
 * @Date 2022/2/25 20:27
 * @Version 1.0
 */
@Service
public class BackendService {
    @Resource
    private BackendMapper backendMapper;
    //登录密码验证
    public Backend login(String backendName,String backendPassword){
        Map<String, String> map = new HashMap<>();
        map.put("backendName",backendName);
        map.put("backendPassword",backendPassword);
        Backend backend = backendMapper.queryByBackendnameAndPassword(map);
        if(backend == null){
            return null;
        }else{
            return backend;
        }
    }
    //查询用户信息通过id
//    public Dev getDevById(int id){
//        return devMapper.getDevById(id);
//    }
}
